package news.service;

import news.util.BaseDao;

/**
 * @author JiangJ
 * @date 2022/3/2 20:26
 */
public class DelTopicServiceImpl implements IDelTopicService {
    BaseDao baseDao = new BaseDao();

    /**
     * 删除
     *
     * @param id
     */
    @Override
    public void delTopic(Integer id) {
        try {
            baseDao.openDB();
            String sql = "delete from news_topic where id = ?";
            baseDao.ps = baseDao.conn.prepareStatement(sql);
            baseDao.ps.setInt(1, id);
            baseDao.ps.execute();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
